/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.code.client2server;

import com.baidu.bjf.remoting.protobuf.Codec;
import com.baidu.bjf.remoting.protobuf.ProtobufProxy;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author dragon
 */
public class RequestPageData {
    public static byte[] EnCode(RequestPageData msg) throws IOException{
        Codec<RequestPageData> Lcode = ProtobufProxy.create(RequestPageData.class);
        return Lcode.encode(msg);
    }
    public static RequestPageData DeCode(byte[] data) throws IOException{
        Codec<RequestPageData> Lcode = ProtobufProxy.create(RequestPageData.class);
        return Lcode.decode(data);
        
    }
    @Protobuf
    private int startIndex;
    @Protobuf
    private int maxResult;
    @Protobuf
    private byte[] filteredColumns;//List<TableCriteria>
    @Protobuf
    private List<String> sortedColumns;
    @Protobuf
    private List<Boolean> sortingOrders;//List<TableColumn.SortType>

    public int getStartIndex() {
        return startIndex;
    }

    public void setStartIndex(int startIndex) {
        this.startIndex = startIndex;
    }

    public int getMaxResult() {
        return maxResult;
    }

    public void setMaxResult(int maxResult) {
        this.maxResult = maxResult;
    }

    
    //    String con = JSON.toJSONString(condition, SerializerFeature.WriteClassName ,SerializerFeature.WriteEnumUsingName,SerializerFeature.WriteDateUseDateFormat);
    //List<TableCriteria> ll= (List<TableCriteria>) JSON.parse(rst6.getBitword());
    //byte[] lsbit = JSON.toJSONBytes(lsc, SerializerFeature.WriteDateUseDateFormat, SerializerFeature.WriteClassName,SerializerFeature.WriteEnumUsingName);

    public List<String> getSortedColumns() {
        return sortedColumns;
    }

    public void setSortedColumns(List<String> sortedColumns) {
        this.sortedColumns = sortedColumns;
    }
    public void setSortedColumns(String sortedColumns,boolean order) {
        if (this.sortedColumns==null){
            this.sortedColumns = new ArrayList();
        }
        this.sortedColumns.add(sortedColumns);
        this.sortingOrders.add(order);
    }

    public List<Boolean> getSortingOrders() {
        return sortingOrders;
    }

    public void setSortingOrders(List<Boolean> sortingOrders) {
        this.sortingOrders = sortingOrders;
    }

    public byte[] getFilteredColumns() {
        return filteredColumns;
    }

    public void setFilteredColumns(byte[] filteredColumns) {
        this.filteredColumns = filteredColumns;
    }
    


}
